home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 21 / Cream of the Crop 21 (Terry Blount) (October 1996).iso / program / slix0987.zip / GMUTILS.ZIP / BOXCRS.DOC < prev    next >
Text File  |  1995-06-22  |  10KB  |  195 lines

  1.                         BOXCR  - Box Creator         
  2.                         BOXCRT - Box Creator, Tweaked
  3.  
  4.                                 Documentation
  5.                               by Petri Hassinen
  6.  
  7.                             Contact via Internet:
  8.                             phassine@alpha.hut.fi
  9.  
  10.  
  11. PURPOSE
  12.          BOXCR(T) is a useful utility for cutting out tiny portions of
  13.          graphics from a larger picture and converting them into a format
  14.          that is easily retrievable from memory. BOXCRS can be used to
  15.          generate sprites and again to view the data back in its original
  16.          visual form.
  17.  
  18.  
  19. OPERATION
  20.          The two described utilities, BOXCR and BOXCRT are, in fact, almost
  21.          similar to each other. The only difference is in the order in which
  22.          they scan the original picture data.
  23.  
  24.          The following pictures illustrate the way the original picture is
  25.          processed. The grid represents a portion of graphics in a larger
  26.          area that is marked with asterisks (*). The numbers indicate the
  27.          order in which the pixels are placed into memory. Each number
  28.          corresponds to exactly one pixel in the picture.
  29.                                               
  30.  
  31.           ...***************************************************...
  32.           ...     *    *    *    *    *    *    *    *    *    *...
  33.           ...*****┌────┬────┬────┬────┬────┬────┬────┐**********...
  34.           ...*    │  1 │  2 │  3 │  4 │  5 │  6 │  7 │    *    *...
  35.           ...*****├────┼────┼────┼────┼────┼────┼────┤**********...
  36.           ...*    │  8 │  9 │ 10 │ 11 │ 12 │ 13 │ 14 │    *    *...
  37.           ...*****├────┼────┼────┼────┼────┼────┼────┤**********...
  38.           ...*    │ 15 │ 16 │ 17 │ 18 │ 19 │ 20 │ 21 │    *    *...
  39.           ...*****├────┼────┼────┼────┼────┼────┼────┤**********...
  40.           ...*    │ 22 │ 23 │ 24 │etc.│    │    │    │    *    *...
  41.           ...*****├────┼────┼────┼────┼────┼────┼────┤**********...
  42.           ...*    │    │    │    │    │    │    │    │    *    *...
  43.           ...*****├────┼────┼────┼────┼────┼────┼────┤**********...
  44.           ...*    │    │    │    │    │    │    │    │    *    *...
  45.           ...*****└────┴────┴────┴────┴────┴────┴────┘**********...
  46.           ...*    *    *    *    *    *    *    *    *         *...
  47.           ...***************************************************...
  48.                     BOXCR - Horizontal mode, 7 x 6 sprite
  49.  
  50.  
  51.                     ┌────┬────┬────┬────┬────┬────┬────┐
  52.                     │  1 │  7 │ 13 │ 19 │    │    │    │ 
  53.                     ├────┼────┼────┼────┼────┼────┼────┤
  54.                     │  2 │  8 │ 14 │ 20 │    │    │    │
  55.                     ├────┼────┼────┼────┼────┼────┼────┤
  56.                     │  3 │  9 │ 15 │ 21 │    │    │    │
  57.                     ├────┼────┼────┼────┼────┼────┼────┤
  58.                     │  4 │ 10 │ 16 │etc.│    │    │    │
  59.                     ├────┼────┼────┼────┼────┼────┼────┤
  60.                     │  5 │ 11 │ 17 │    │    │    │    │
  61.                     ├────┼────┼────┼────┼────┼────┼────┤
  62.                     │  6 │ 12 │ 18 │    │    │    │    │
  63.                     └────┴────┴────┴────┴────┴────┴────┘
  64.                      BOXCR - Vertical mode, 7 x 6 sprite
  65.  
  66.  
  67.                     ┌────┬────┬────┬────┬────┬────┬────┐
  68.                     │  1 │  3 │  5 │  7 │  2 │  4 │  6 │ 
  69.                     ├────┼────┼────┼────┼────┼────┼────┤
  70.                     │  8 │ 10 │ 12 │ 14 │  9 │ 11 │ 13 │
  71.                     ├────┼────┼────┼────┼────┼────┼────┤
  72.                     │ 15 │ 17 │etc.│    │    │    │    │
  73.                     ├────┼────┼────┼────┼────┼────┼────┤
  74.                     │    │    │    │    │    │    │    │
  75.                     ├────┼────┼────┼────┼────┼────┼────┤
  76.                     │    │    │    │    │    │    │    │
  77.                     ├────┼────┼────┼────┼────┼────┼────┤
  78.                     │    │    │    │    │    │    │    │
  79.                     └────┴────┴────┴────┴────┴────┴────┘
  80.                    BOXCRT - Horizontal mode, 7 x 6 sprite
  81.  
  82.  
  83.                     ┌────┬────┬────┬────┬────┬────┬────┐
  84.                     │  1 │ 13 │ 25 │ 37 │  7 │ 19 │ 31 │ 
  85.                     ├────┼────┼────┼────┼────┼────┼────┤
  86.                     │  2 │ 14 │ 26 │ 38 │  8 │ 20 │ 32 │
  87.                     ├────┼────┼────┼────┼────┼────┼────┤
  88.                     │  3 │ 15 │ 27 │ 39 │  9 │ 21 │ 33 │
  89.                     ├────┼────┼────┼────┼────┼────┼────┤
  90.                     │  4 │ 16 │ 28 │ 40 │ 10 │ 22 │ 34 │
  91.                     ├────┼────┼────┼────┼────┼────┼────┤
  92.                     │  5 │ 17 │ 29 │ 41 │ 11 │ 23 │ 35 │
  93.                     ├────┼────┼────┼────┼────┼────┼────┤
  94.                     │  6 │ 18 │ 30 │ 42 │ 12 │ 24 │ 36 │
  95.                     └────┴────┴────┴────┴────┴────┴────┘
  96.                     BOXCRT - Vertical mode, 7 x 6 sprite
  97.  
  98.  
  99.          It is up to you which method, horizontal or vertical, you choose to
  100.          use in your routines. For optimized performance, vertical mode can
  101.          sometimes be handy.
  102.  
  103.          The order in which the pixels are processed in BOXCRT may seem
  104.          strange at first but it is completely equivalent to the way the data
  105.          is seen by the hardware. At least this holds true for the tweaked
  106.          320x200x256 mode.
  107.  
  108.          BOXCRS "cut" only entire boxes (sprites) from the original picture
  109.          file. In other words, if the user specified a value 15 for the box
  110.          width BOXCRS would cut only (320/15=21.333) 21 boxes from each
  111.          horizontal line. The same rule is also applicable to vertical line.
  112.          Furthermore, the user may give the exact number of boxes that he/she
  113.          wishes to create. The size of the resulting output file is directly
  114.          proportional to the created boxes (xsize*ysize*number).
  115.  
  116.          You can also view the processed file (LBM & RAW) by typing its name
  117.          after BOXCR(T). This way you can make sure, that the created boxes
  118.          are correct and the original file is decoded correctly. Namely,
  119.          BOXCRS do not recognize the full LBM format but the sub format PBM
  120.          only. If you have an older LBM file using ILBM format, you can
  121.          convert it into PBM format with PPFIX.
  122.  
  123.          For more information, type "BOXCR /?" or "BOXCRT /?" at the DOS
  124.          prompt.
  125.  
  126.  
  127. EXAMPLES
  128.          Suppose that you have a picture file that has the shapes of many
  129.          sprites you want to generate (just like EXPLODE.LBM - see it!). You
  130.          can use BOXCRS to generate the sprite data, but before that, you
  131.          must find out the size of a sprite block.
  132.  
  133.          Let's assume that you want to generate 5 explosion sprites that are
  134.          found in EXPLODE.LBM. To do this, type:
  135.          BOXCR explode.lbm /57 /46 /5
  136.  
  137.          To later see how the sprite data looks back in its "understandable"
  138.          form, type:
  139.          BOXCR explode.raw /57 /46 /B
  140.  
  141.          Note! You must remember the box sizes to see the file correctly.
  142.  
  143.          You can facilitate the process of finding the correct box sizes by
  144.          using ANIME. Namely, if your original sequence file animates
  145.          correctly, you can use the same dimensions with BOXCRS as well. I
  146.          found the previous values in this example by looking at the contents
  147.          of ADEMO.BAT - sequence number 5 (label :exp).
  148.  
  149.  
  150. CRSPR.BAT - What is it?
  151.          On the other hand, if you want to create sprites that are found in
  152.          several files (one in each file) you cannot efficiently use BOXCRS
  153.          for that. This can be relevant if you do not draw your sprites
  154.          yourself but render them with e.g. a CAD program.
  155.  
  156.          For situations like these, I have written a batch named CRSPR.BAT.
  157.          Run it, and it will tell you how to proceed.
  158.  
  159.          If you necessarily want to save disk space (concerns temporary *.TRN
  160.          files), you can modify the batch so that it accepts 'ending_address'
  161.          as well (see help first by typing CRSPR). Namely, the current
  162.          versi